package com.syaccp.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.syaccp.model.TMessage;
import com.syaccp.vo.TMessageVo;
import org.apache.ibatis.annotations.Mapper;

import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author syaccp
 * @since 2023-07-15
 */
@Mapper
public interface TMessageMapper extends BaseMapper<TMessage> {

    List<TMessageVo> getMessageByReceiverId(TMessageVo tMessageVo)throws SQLException;

    boolean delMessage(Integer id)throws SQLException;

    boolean delMessageReceiver(Integer message_id,Integer receiver_id)throws SQLException;

    List<TMessageVo> getNotRead(TMessageVo tMessageVo)throws SQLException;

    boolean updateIsRead(TMessageVo tMessageVo)throws SQLException;

    List<TMessageVo> selectNotReadMessage(TMessageVo tMessageVo)throws SQLException;
    boolean allRead(TMessageVo tMessageVo)throws SQLException;

    int insert(TMessageVo tMessageVo);

    int insertMessageReceiver(TMessageVo tMessageVo)throws SQLException;
}
